#!/bin/bash

# bash -x submit/docker_build.sh
# 如果是离线训练，至少先train一次生成模型
# python cmd/train.py

# 删除cache
find . |grep -E  __pycache__$ | xargs -i rm -rf {}

\cp submit/run.sh .
tar czf src.tar.gz cfg cmd src model run.sh tmp/vocab

rm -rf run.sh
mv src.tar.gz submit

pushd submit

currentTime=`date "+%Y%m%d%H%M%S"`
docker build -t submit_result:date_${currentTime} .

rm -rf src.tar.gz

popd